<body style="background-color: #ffffff">

<h2 align="center"> <%=h "#{@event.semester}" %> </h2>

<h2 align="center"> <%=h @event.name %> </h2>


<table class="events_list" align="center">
	<tr>
		<td>Date:</td>
		<td> <%=h @event.date.strftime("%A, %b %d at %I:%M %p") %> </td>
	</tr>

	<tr>
		<td> Number of Hours </td>
		<td> <%=h @event.hours %> </td>
	</tr>

	<tr>
		<td>Member In Charge: </td>
		<% if @event.mic == nil%>
			<td> None </td>
		<% else %>
			<td> <%= link_to h("#{@event.mic.full_name}") , :action => "show" , :controller => "members", :id => @event.mic %> </td>
		<% end %>
	</tr>

</table>

<h2 align="center"> Members Sign In Sheet </h2>

<h3 align="center"> Online Members </h3>

<table class="lfs" align="center">
	<tr>
		<th align="center"> Member </th>
		<th align="center"> Phone Number </th>
		<th align="center"> Time In </th>
		<th align="center"> Time Out </th>
		<th align="center"> Driver </th>
		<th align="center"> Attended </th>
	</tr>

  <% records = AttendanceRecord.find_all_by_event_id(@event.id, :conditions => "waitlist = 0") %>
	<% records.sort!{|a,b| a.member.last_name <=> b.member.last_name} %>
	<% records.each do |record| %>
	<tr>
		<td align="center"> <%=h record.member.full_name %> </td>
		<td align="center"> <%=h record.member.phone_number %> </td>
		<td align="center"> <%= "______" %> </td>
		<td align="center"> <%= "______" %> </td>
		<td align="center"> <%= check_box_tag "driver", "no",  false %> </td>
		<td align="center"> <%= check_box_tag "attended", "no",  false %> </td>
	</tr>
	<% end %>
</table>

<% extra_spots = @event.max_attendees - @event.members.size %>

<% if (extra_spots > 0) %>

	<h3 align= "center"> Walk On Members </h3>
	<table class="lfs" align="center">
		<tr>
			<th align="center"> Member </th>
			<th align="center"> Time In </th>
			<th align="center"> Time Out </th>
			<th align="center"> Driver </th>
			<th align="center"> Attended </th>
		</tr>

	<% iterator = 0 %>
	<% while (iterator < extra_spots) %>
	<tr>
		<td align="center"> <%= iterator +1 %> <%= ")_________________" %> </td>
		<td align="center"> <%= "______" %> </td>
		<td align="center"> <%= "______" %> </td>
		<td align="center"> <%= check_box_tag "driver", "no",  false %> </td>
		<td align="center"> <%= check_box_tag "attended", "no",  false %> </td>
	</tr>
	<% iterator = iterator + 1 %>
	<% end %>

</table>

<% end %>

</body>
